package pt.gil.myexpenses;

import android.app.Activity;
import android.app.Dialog;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.ListView;

public class myExpenses extends Activity {
	
	protected SQLiteDatabase db;
	protected ListView transactionList;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        db = (new DBAdapter(this)).getWritableDatabase();        
    }
    
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    	MenuInflater inflater = getMenuInflater();
    	inflater.inflate(R.menu.menu, menu);
    	return true;
    }
    
 // This method is called once the menu is selected
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		// We have only one menu option
		case R.id.addcategory:
			Dialog dialog = new Dialog(this);
			dialog.setContentView(R.layout.categories_dialog);
			dialog.setTitle("This is my custom dialog box");
			dialog.setCancelable(true);
			dialog.show();
			break;

		}
		return true;
	}
}